from flask import Flask, render_template, jsonify
from utils.analyse import *

app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/table')
def table():
    return jsonify(rating_anime())


@app.route('/bar')
def bar():
    return jsonify(type_count_top10())


@app.route('/area')
def area():
    return jsonify(year_anime_count())


@app.route('/pie_status')
def pie_status():
    return jsonify(status_pie())


@app.route('/word_count')
def word_count():
    return jsonify(type_word_count())


@app.route('/scatter')
def scatter():
    return jsonify(rating_scatter())


if __name__ == '__main__':
    app.run()
